package com.tdkj.model.enterprisezone;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;
import com.tdkj.model.user.BeanUser;

@Entity
@Table(name = "ezone")
public class BeanEnterpriseZone extends BaseEntity{

	private String name ;
	private String description;
	private Set<BeanEnterpriseZoneFriendsLink> friendslink = new HashSet<BeanEnterpriseZoneFriendsLink>(0);
	private List<BeanEnterpriseZoneVisitor> visitor = new ArrayList<BeanEnterpriseZoneVisitor>();
	private BeanEnterpriseZoneDecorate ezoneDecorate ;
	
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	@OneToMany( fetch = FetchType.EAGER, mappedBy = "enterpriseZone")
	public Set<BeanEnterpriseZoneFriendsLink> getFriendslink() {
		return friendslink;
	}

	public void setFriendslink(Set<BeanEnterpriseZoneFriendsLink> friendslink) {
		this.friendslink = friendslink;
	}
	
	@OneToMany( fetch = FetchType.EAGER, mappedBy = "enterpriseZone")
	@OrderBy(value="visitTime DESC")
	public List<BeanEnterpriseZoneVisitor> getVisitor() {
		return visitor;
	}
	public void setVisitor(List<BeanEnterpriseZoneVisitor> visitor) {
		this.visitor = visitor;
	}
	
	@OneToOne( fetch = FetchType.EAGER ,cascade = CascadeType.ALL) 
	public BeanEnterpriseZoneDecorate getEzoneDecorate() {
		return ezoneDecorate;
	}
	public void setEzoneDecorate(BeanEnterpriseZoneDecorate ezoneDecorate) {
		this.ezoneDecorate = ezoneDecorate;
	}
	
}